import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token';

export const articleCategoryListService = () =>{
    return request.get('/category');
}

export const articleCategoryAllListService = () =>{
    return request.get('/category/all');
}

export const articleCategoryAddService = (category) => {
    return request.post('/category',category);
}


export const articleCategoryUpdateService = (category) =>{
    return request.put('/category',category);
}

export const articleCategoryDeleteService = (id) =>{
    return request.delete('/category?id='+id);
}
//文章列表查询
export const articleListService = (params) => {
    return request.get('/article',{params:params});
}

//文章添加
export const articleAddService = (article) =>{
    return request.post("/article",article);
}

export const articleUpdateService  = (article) =>{
    return request.put('/article',article);
}

export const articleDeleteService = (id) =>{
    return request.delete('/article?id='+id);
}